import request from '@/utils/request'
import type { skuResponseData,SkuInfoData } from './type'

//sku接口管理
// export const reqSkuList=(page:number,limit:number)=>request({
//     url:`/admin/product/list/${page}/${limit}`,
//     method:'get'
// })
//获取已有商品的sku数据接口
export const reqSkuListAPI = (page: number, limit: number) =>
  request.get<any, skuResponseData>(`/admin/product/list/${page}/${limit}`)

//上架sku接口
export const reqSkuOnSaleAPI = (skuId: number) =>
  request.get<any, any>(`/admin/product/onSale/${skuId}`)
//下架sku接口
export const reqSkuCancelSaleAPI = (skuId: number) =>
  request.get<any, any>(`/admin/product/cancelSale/${skuId}`)
//得到商品sku信息接口
export const reqSkuInfoAPI = (skuId: number) =>
  request.get<any, SkuInfoData>(`/admin/product/getSkuInfo/${skuId}`)
//删除商品sku接口
export const reqDeleteSkuAPI = (skuId: number) =>
  request.delete<any, any>(`/admin/product/deleteSku/${skuId}`)